import { pubRequire } from '@utils/public'
const base = '/activities/posters-introductions'
//获取一级渠道
export function getIntroduceChannel(params, callbBack, errBack) {
  return pubRequire('get', `${base}/introduce-channel`, '', callbBack, errBack)
}
//二级渠道校验
export function channelVerify(params, callbBack, errBack) {
  return pubRequire('get',`${base}/exists-introduce-channel/${params.channelCode}/${params.secondChannelName}`, '', callbBack, errBack)
}
/* 落地页 */
export function landingPageName(obj, callbBack, errBack) {
  return pubRequire('get',`/landing-pages/landing-names`, obj, callbBack, errBack)
}
/* 分组 */
export function getGroupUserList(obj, sucBack, errBack) {
  pubRequire('get', '/user-group/component-list/', obj, sucBack, errBack)
}
// 按照分组Id查询分组信息
export function groupDetail(ids, {}, callBack, errBack) {
  return pubRequire('get', `/user-group/detail/${ids}`, '', callBack, errBack)
}
/* 一级分类 */
export function getOneClass(obj, sucBack, errBack) {
  pubRequire('get', '/activities/invitation/one-class', obj, sucBack, errBack)
}
/* 二级分类 */
export function getTowClass( id, obj, sucBack, errBack) {
  pubRequire('get', `/activities/invitation/two-class/${id}`, obj, sucBack, errBack)
}
/* 商品列表 */
export function getPrizeList(obj, callBack, errBack) {
  return pubRequire('get', `/activities/prizes`, obj, callBack, errBack)
}
/* 禁用商品 */
export function prizeDisable(id, obj, callBack, errBack) {
  return pubRequire('put',`/activities/prizes/${id}/disable`, obj, callBack, errBack)
}
/* 启用商品 */
export function prizeEnable(id, obj, callBack, errBack) {
  return pubRequire('put', `/activities/prizes/${id}/enable`, obj, callBack, errBack)
}
/* 新增商品 */
export function addPrize(obj, callBack, errBack) {
  return pubRequire('post', `/activities/prizes`, obj, callBack, errBack)
}
/* 新增详情 */
export function getPrizeDetail(id, obj, callBack, errBack) {
  return pubRequire('get', `/activities/prizes/${id}`, obj, callBack, errBack)
}
/* 编辑商品 */
export function editPrize(id, obj, callBack, errBack) {
  return pubRequire('put', `/activities/prizes/${id}`, obj, callBack, errBack)
}